using UnityEngine;
using System.Collections;

public class EventChangeCharacter : MonoBehaviour {

	GUIButton button;
	public bool nextChar; 
	void Start ()
	{
		button = gameObject.GetComponent<GUIButton>();
		button.OnClickCallback += OnClick;
	}
	
	void OnClick(Vector3 pos){
		if (nextChar){
		AttributesController.GetInstance().SetActiveCharacter(
			CharacterDataManager.GetInstance().GetNextCharData().attributes );
		Debug.Log("CHANGE CHAR++");
		}else{
		AttributesController.GetInstance().SetActiveCharacter(
			CharacterDataManager.GetInstance().GetPreviousCharData().attributes );
		Debug.Log("CHANGE CHAR--");
		}
		AttributesController.GetInstance().UpdateStats();
	}
}
